<template>
  <div class="header">
    <div class="header__right">
      <div class="iconfont header__left__icon">&#xe658;</div>
    </div>
    <div class="header__search">
      <span class="iconfont header__search__icon">&#xe63c;</span
      >输入城市/景点/游玩主题
    </div>
    <router-link to="/city">
      <div class="header__right">
        {{ this.city }}
        <span class="iconfont header__right__icon">&#xe65c;</span>
      </div>
    </router-link>
  </div>
</template>
<script>
import { mapState } from "vuex";
export default {
  name: "HomeHeader",
  computed: {
    ...mapState(["city"]),
  },
};
</script>
<style lang="scss" scoped>
.header {
  display: flex;
  line-height: 0.86rem;
  color: #fff;
  background-color: #00bcd4;
  &__left {
    float: left;
    &__icon {
      font-size: 0.5rem;
      text-align: center;
    }
  }
  &__search {
    flex: 1;
    margin-top: 0.14rem;
    margin-right: 0.2rem;
    height: 0.58rem;
    line-height: 0.58rem;
    color: #eee;
    background-color: #fff;
    border-radius: 0.1rem;
    &__icon {
      margin: 0 0.14rem;
      font-size: 0.35rem;
    }
  }
  &__right {
    float: right;
    padding: 0 0.12rem;
    color: #fff;
    text-align: center;
    &__icon {
      margin-left: -0.04rem;
      font-size: 0.3rem;
    }
  }
}
</style>